package o;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TabHost.TabSpec;
import android.widget.TextView;
import com.huawei.appgallery.assistantdock.base.externalaction.openviewaction.NetConfigAction;
import com.huawei.appgallery.forum.base.card.bean.Section;
import com.huawei.appgallery.forum.base.https.jgw.JGWTabDetailResponse;
import com.huawei.appgallery.forum.base.https.jgw.JGWTabInfo;
import com.huawei.appgallery.forum.cards.card.ForumPostCard;
import com.huawei.appgallery.forum.section.bean.ForumNoticeCardBean;
import com.huawei.appgallery.forum.section.bean.ForumSectionEnterCardBean;
import com.huawei.appgallery.forum.section.bean.ForumSectionHeadCardBean;
import com.huawei.appgallery.forum.section.buoy.action.OpenPublishPostAction;
import com.huawei.appgallery.forum.section.buoy.widget.SegmentTabHost;
import com.huawei.appgallery.forum.section.card.BuoyForumSectionHeadCard;
import com.huawei.appgallery.forum.section.card.ForumNoticeCard;
import com.huawei.appgallery.forum.section.fragment.ForumSectionDetailFragment;
import com.huawei.appgallery.forum.section.node.BuoyForumNoticeNode;
import com.huawei.appgallery.forum.section.view.widget.SectionDetailSubHead;
import com.huawei.appgallery.forum.section.view.widget.SectionNestScrollLayout;
import com.huawei.appgallery.foundation.account.bean.UserSession;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.gamebox.plugin.gameservice.view.TransferActivity;
import com.huawei.hms.framework.network.restclient.hwhttp.route.IPRoute;
import com.huawei.secure.android.common.intent.SafeBroadcastReceiver;
import java.io.Serializable;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;

import o.cab.i;
import o.cab.j;

public class cap extends bgq implements chy, com.huawei.appgallery.forum.section.view.widget.SectionNestScrollLayout.c, bhd, com.huawei.appgallery.forum.section.view.widget.SectionDetailSubHead.d, AccountBussinessListener {
    private String ʻ;
    private String ʼ;
    private LoadingController ʼॱ;
    private String ʽ;
    private SectionNestScrollLayout ʽॱ;
    private int ʾ = 0;
    private ImageView ʿ;
    private int ˈ = -1;
    private final BroadcastReceiver ˉ = new d();
    protected long ˊ;
    private List<WeakReference<cal>> ˊˊ = new ArrayList();
    private ViewGroup ˊˋ;
    private cay ˊॱ;
    private cao ˊᐝ;
    private SegmentTabHost ˋˊ;
    private c ˋˋ;
    private SectionDetailSubHead ˋॱ;
    private SafeBroadcastReceiver ˋᐝ = new SafeBroadcastReceiver(this) {
        final /* synthetic */ cap ˋ;

        {
            this.ˋ = r1;
        }

        public void onReceiveMsg(Context context, Intent intent) {
            if (context == null || intent == null) {
                bqx.ॱ("ForumSectionDetailSegment", "onReceive, context = " + context + ", intent = " + intent);
                return;
            }
            String action = intent.getAction();
            if (e.ॱ.equals(action)) {
                bqx.ˊ("ForumSectionDetailSegment", "onReceive: REFRESH_ALL_CARD_ACTION" + this.ˋ.ʼ);
                this.ˋ.ˎˎ.post(new a(this.ˋ));
            } else if ("cardlist_show_toast_action".equals(action)) {
                action = intent.getStringExtra("toast_tips");
                if (!TextUtils.isEmpty(action) && this.ˋ.ʾ() && this.ˋ.ˈ()) {
                    ezn.ˊ().ˊ(action);
                } else {
                    bqx.ˋ("ForumSectionDetailSegment", "onReceive, tips: " + action + ", isInFront = " + this.ˋ.ʾ() + ", isSelected = " + this.ˋ.ˈ());
                }
            }
        }
    };
    private bfa ˎ;
    private Handler ˎˎ = new Handler();
    private dey ˏ;
    private int ˏॱ;
    private ForumSectionHeadCardBean ͺ;
    private List<ForumNoticeCardBean> ॱˊ;
    private LinearLayout ॱˋ;
    private FrameLayout ॱˎ;
    private int ॱॱ;
    private String ᐝ;
    private List<JGWTabInfo> ᐝॱ;

    public interface c {
        void ˋ(int i);
    }

    public static class a implements Runnable {
        private WeakReference<cap> ˏ;

        a(cap o_cap) {
            this.ˏ = new WeakReference(o_cap);
        }

        public void run() {
            cap o_cap = (cap) this.ˏ.get();
            if (o_cap == null) {
                bqx.ॱ("ForumSectionDetailSegment", "ReloadRunnable, listSegment == null");
                return;
            }
            cat.ˋ().ॱ();
            car.ˏ().ˋ();
            o_cap.ˌ();
        }
    }

    class b implements cao {
        final /* synthetic */ cap ˎ;

        private b(cap o_cap) {
            this.ˎ = o_cap;
        }

        public /* synthetic */ bgz ˏ(int i) {
            return ˊ(i);
        }

        public int ˊ() {
            return this.ˎ.ᐝॱ.size();
        }

        public cal ˊ(int i) {
            Bundle bundle = new Bundle();
            bundle.putString("DOMAINID", this.ˎ.ʽ);
            bundle.putString("APPID", this.ˎ.ᐝ);
            bundle.putString("SEGMENT_URI", new cau().ˊ((JGWTabInfo) this.ˎ.ᐝॱ.get(i), this.ˎ.ॱॱ));
            bundle.putBoolean("IS_DATA_READY", false);
            bundle.putBoolean("IS_TAB_PAGE", true);
            return cal.ˊ(this.ˎ.ॱᐝ, bundle);
        }

        public void ˎ(int i, bgz o_bgz, bgz o_bgz2) {
            if (!(o_bgz2 == o_bgz || o_bgz2 == null)) {
                o_bgz2.ᐝ(false);
            }
            if (o_bgz instanceof cal) {
                cal o_cal = (cal) o_bgz;
                o_cal.ᐝ(true);
                boolean z = false;
                for (WeakReference weakReference : this.ˎ.ˊˊ) {
                    boolean z2;
                    if (o_cal.equals((cal) weakReference.get())) {
                        z2 = true;
                    } else {
                        z2 = z;
                    }
                    z = z2;
                }
                if (!z) {
                    this.ˎ.ˊˊ.add(new WeakReference(o_cal));
                }
            }
            this.ˎ.ʾ = i;
        }

        public boolean ˏ(int i, TabSpec tabSpec) {
            if (!(this.ˎ.ᐝॱ == null || this.ˎ.ᐝॱ.isEmpty())) {
                JGWTabInfo jGWTabInfo = (JGWTabInfo) this.ˎ.ᐝॱ.get(i);
                if (jGWTabInfo != null) {
                    tabSpec.setIndicator(jGWTabInfo.ᐝ());
                    return true;
                }
            }
            return false;
        }

        public String ˋ(int i) {
            if (!(this.ˎ.ᐝॱ == null || this.ˎ.ᐝॱ.isEmpty())) {
                JGWTabInfo jGWTabInfo = (JGWTabInfo) this.ˎ.ᐝॱ.get(i);
                if (jGWTabInfo != null) {
                    return jGWTabInfo.ʼ();
                }
            }
            return String.valueOf(i);
        }
    }

    static final class d extends SafeBroadcastReceiver {
        private d() {
        }

        public void onReceiveMsg(Context context, Intent intent) {
            if (ForumPostCard.ˊ.equals(intent.getAction()) && UserSession.getInstance().isLoginSuccessful()) {
                try {
                    long longExtra = intent.getLongExtra("post_id", -1);
                    if (-1 != longExtra) {
                        car.ˏ().ॱ(longExtra);
                    }
                } catch (Exception e) {
                    bqx.ॱ("ForumSectionDetailSegment", "SECTION_POST_READ_ACTION error");
                }
            }
        }
    }

    public void ˊ(c cVar) {
        this.ˋˋ = cVar;
    }

    public void ˎ(bfa o_bfa) {
        this.ˎ = o_bfa;
    }

    public void ॱ(Bundle bundle) {
        if (ˉ() == null) {
            bqx.ॱ("ForumSectionDetailSegment", "onCreate, context is null");
            return;
        }
        super.ॱ(bundle);
        this.ʼ = hashCode() + this.ʻ;
        ˏॱ();
        ˋˋ();
    }

    private void ˏॱ() {
        try {
            this.ॱॱ = Integer.parseInt(new cau().ˎ(this.ʻ));
        } catch (Exception e) {
            bqx.ˋ("ForumSectionDetailSegment", "get sectionId error");
        }
    }

    private void ˏ(ViewGroup viewGroup) {
        this.ʿ = (ImageView) viewGroup.findViewById(cab.e.ꜟ);
        this.ʿ.setOnClickListener(new OnClickListener(this) {
            final /* synthetic */ cap ˎ;

            {
                this.ˎ = r1;
            }

            public void onClick(View view) {
                this.ˎ.ॱᐝ();
            }
        });
    }

    private void ॱᐝ() {
        if (bsd.ॱ(this.ˊ)) {
            ezn.ˊ().ˊ(this.ॱᐝ.getString(j.ˊ));
            return;
        }
        int ˋ;
        Intent intent;
        if (this.ͺ != null) {
            Section ˊ = this.ͺ.ˊ();
            if (ˊ != null) {
                ˋ = ˊ.ˋ();
                if (ˋ != 1) {
                    ezn.ˊ().ˊ(this.ॱᐝ.getString(bse.ˏ.ॱ(400009).ˏ()));
                }
                intent = new Intent(this.ॱᐝ, TransferActivity.class);
                intent.setAction(OpenPublishPostAction.ACTION_OPEN_FORUM_PUBLISH_POST);
                intent.putExtra("SectionId", this.ॱॱ);
                if (this.ͺ != null) {
                    intent.putExtra("DomainId", this.ͺ.ॱ());
                }
                OpenPublishPostAction.registerCall(new com.huawei.appgallery.forum.section.buoy.action.OpenPublishPostAction.d(this) {
                    final /* synthetic */ cap ˎ;

                    {
                        this.ˎ = r1;
                    }

                    public void ˏ(byd o_byd) {
                        if (o_byd != null) {
                            this.ˎ.ॱ(o_byd);
                        }
                    }
                });
                ((faj) cdb.ॱ(faj.class)).ˎ(this.ॱᐝ, TransferActivity.class, intent, false);
                return;
            }
        }
        ˋ = 0;
        if (ˋ != 1) {
            intent = new Intent(this.ॱᐝ, TransferActivity.class);
            intent.setAction(OpenPublishPostAction.ACTION_OPEN_FORUM_PUBLISH_POST);
            intent.putExtra("SectionId", this.ॱॱ);
            if (this.ͺ != null) {
                intent.putExtra("DomainId", this.ͺ.ॱ());
            }
            OpenPublishPostAction.registerCall(/* anonymous class already generated */);
            ((faj) cdb.ॱ(faj.class)).ˎ(this.ॱᐝ, TransferActivity.class, intent, false);
            return;
        }
        ezn.ˊ().ˊ(this.ॱᐝ.getString(bse.ˏ.ॱ(400009).ˏ()));
    }

    private void ॱ(byd o_byd) {
        if (this.ˊᐝ != null) {
            cal o_cal = null;
            for (WeakReference weakReference : this.ˊˊ) {
                if (weakReference != null) {
                    cal o_cal2 = (cal) weakReference.get();
                    if (o_cal2 != null) {
                        String ˎˎ = o_cal2.ˎˎ();
                        if (ˎˎ != null && ˎˎ.startsWith("buoy_forum|forum_detail_all")) {
                            o_cal = o_cal2;
                            break;
                        }
                    }
                    continue;
                }
            }
            if (o_cal != null) {
                cia ˌ = o_cal.ˌ();
                if (ˌ instanceof cax) {
                    cax o_cax = (cax) ˌ;
                    o_cax.ˊ(o_byd, this.ʽ);
                    o_cal.ʼ(true);
                    o_cax.ͺ();
                    o_cal.ˊ(0);
                }
            }
            this.ˎˎ.postDelayed(new Runnable(this) {
                final /* synthetic */ cap ˏ;

                {
                    this.ˏ = r1;
                }

                public void run() {
                    this.ˏ.ˋॱ.ˋ(this.ˏ.ˏॱ);
                }
            }, 100);
        }
    }

    public void ʼॱ() {
        if (ˉ() == null) {
            bqx.ॱ("ForumSectionDetailSegment", "onSetting, context is null");
            return;
        }
        Intent intent = new Intent(ˉ(), TransferActivity.class);
        intent.setAction(NetConfigAction.ACTION_NET_CONFIG);
        ((faj) cdb.ॱ(faj.class)).ˎ(this.ॱᐝ, TransferActivity.class, intent, false);
    }

    public void ॱ(String str, String str2) {
        cat.ˋ().ˎ(str, str2);
        if (!doo.ˊ(this.ॱᐝ) || this.ˋˊ == null) {
            ezn.ˊ().ˊ(fis.ˎ().getString(j.ˈ));
            return;
        }
        bgz ˏ = this.ˋˊ.ˏ();
        if (ˏ instanceof cal) {
            cal o_cal = (cal) ˏ;
            o_cal.ॱ(new cau().ˎ(str, this.ॱॱ, str2));
            o_cal.ˊᐝ();
        }
    }

    public void ˊ(dey o_dey) {
        this.ˏ = o_dey;
    }

    public boolean ॱ() {
        if (!(this.ˊᐝ == null || this.ˋˊ == null)) {
            bgz ˏ = this.ˋˊ.ˏ();
            if (ˏ instanceof ciz) {
                return ((ciz) ˏ).ad_();
            }
            bqx.ॱ("ForumSectionDetailSegment", "unknown type, segment:" + ˏ);
        }
        return false;
    }

    public void ˏ(int i, int i2) {
        this.ˈ = i;
    }

    public void onAccountBusinessResult(ccp o_ccp) {
        if (o_ccp == null) {
            bqx.ॱ("ForumSectionDetailSegment", "onAccountBusinessResult, accountResult == null");
        } else if (102 == o_ccp.ˎ || 103 == o_ccp.ˎ) {
            bqx.ˊ("ForumSectionDetailSegment", "onAccountBusinessResult, login status: " + o_ccp);
            this.ˎˎ.post(new a(this));
        }
    }

    protected void ͺ() {
        Bundle ˊˊ = ˊˊ();
        if (ˊˊ != null) {
            this.ʻ = ˊˊ.getString("SEGMENT_URI");
            this.ॱ = ˊˊ.getBoolean("IS_DATA_READY", false);
            this.ᐝ = ˊˊ.getString("APPID");
            this.ʽ = ˊˊ.getString("DOMAIN_ID");
            return;
        }
        bqx.ॱ("ForumSectionDetailSegment", "parserArguments, arguments is null");
    }

    public View ˋॱ() {
        super.ˋॱ();
        if (ˉ() == null) {
            bqx.ॱ("ForumSectionDetailSegment", "onCreateView, context is null");
            return null;
        }
        cgu.ˎ(ˉ());
        ViewGroup viewGroup = (ViewGroup) LayoutInflater.from(ˉ()).inflate(ˏ(), null, false);
        ˊ(viewGroup);
        super.ˋॱ();
        return viewGroup;
    }

    private void ˊ(ViewGroup viewGroup) {
        this.ʽॱ = (SectionNestScrollLayout) viewGroup.findViewById(cab.e.ᶥ);
        this.ʽॱ.setOnScrollListener(this);
        this.ॱˋ = (LinearLayout) viewGroup.findViewById(cab.e.ꜞ);
        this.ˋॱ = (SectionDetailSubHead) viewGroup.findViewById(cab.e.ﾟ);
        this.ॱˎ = (FrameLayout) viewGroup.findViewById(cab.e.ˋˋ);
        this.ˋˊ = (SegmentTabHost) viewGroup.findViewById(16908306);
        this.ˊˋ = (ViewGroup) viewGroup.findViewById(cab.e.ᐧ);
        ImageView imageView = (ImageView) this.ˊˋ.findViewById(cab.e.ᐝˊ);
        TextView textView = (TextView) this.ˊˋ.findViewById(cab.e.ᐨ);
        brz ॱ = bse.ˏ.ॱ(400001);
        imageView.setBackgroundResource(o.cab.d.ॱ);
        textView.setText(ॱ.ˎ());
        ˏ(viewGroup);
        this.ʼॱ = ॱˋ();
        this.ˋˊ.setup(this.ॱᐝ, cab.e.ˋˋ, this.ˏ);
        this.ˋॱ.setTabHost(this.ˋˊ);
        this.ˋॱ.setSpinnerClickLisenter(this);
        this.ˋॱ.setSelectedTextColor(fo.ˋ(this.ॱᐝ, o.cab.b.ʻ));
        this.ˋॱ.setNormalTextColor(fo.ˋ(this.ॱᐝ, o.cab.b.ᐝ));
        viewGroup.addView(this.ʼॱ.ˏ(LayoutInflater.from(ˉ())));
        if (this.ˊॱ == null) {
            this.ʼॱ.ˋ();
        } else {
            ॱˎ();
        }
    }

    private void ˎ(BaseRequest o_cvu, ResponseBean responseBean) {
        if (this.ॱᐝ != null) {
            this.ˊॱ = new cay(this.ॱᐝ);
            cay.ˋ(this.ˊॱ, o_cvu, responseBean);
        }
    }

    private LoadingController ॱˋ() {
        LoadingController o_bgy = new LoadingController();
        o_bgy.ˏ((bhd) this);
        o_bgy.ˎ(new OnClickListener(this) {
            final /* synthetic */ cap ॱ;

            {
                this.ॱ = r1;
            }

            public void onClick(View view) {
                bqx.ˊ("ForumSectionDetailSegment", "createLoadingController onClick, onLoadingRetry");
                this.ॱ.ˊˋ();
            }
        });
        return o_bgy;
    }

    public void onResume() {
        super.onResume();
        ʻ(true);
        if (this.ˊॱ == null) {
            bqx.ˊ("ForumSectionDetailSegment", "detailProvider is null");
        } else {
            this.ˊॱ.ͺ();
        }
    }

    protected int ˏ() {
        return i.ॱˎ;
    }

    public void ˏ(int i, cih o_cih) {
        if (i == 0 || 9 == i) {
            BaseCardBean baseCardBean = (BaseCardBean) o_cih.ˌ();
            if (baseCardBean == null || baseCardBean.ॱॱ() == null || ˉ() == null) {
                bqx.ˊ("ForumSectionDetailSegment", "params is null");
                return;
            }
            if (!cii.ˊ().ˊ(ˉ(), baseCardBean)) {
                ezn.ˊ().ˊ(ˉ().getResources().getString(j.ॱ));
                bqx.ॱ("ForumSectionDetailSegment", "onClick, dispatch failed, uri = " + baseCardBean.ॱॱ());
            }
            ((bev) cdb.ॱ(bev.class)).ˎ(baseCardBean.ॱॱ());
        }
    }

    public List<CardBean> ˎ(String str, String str2) {
        return null;
    }

    public void ॱ(bgq o_bgq, List<cvs> list) {
        list.add(new brm.e(this.ʻ).ˏ(bsv.ॱ(this.ʽ)).ॱ(this.ᐝ).ॱ());
    }

    public boolean ॱ(bgq o_bgq, bgq.e eVar) {
        BaseRequest o_cvu = eVar.mReq;
        ResponseBean responseBean = eVar.mResp;
        if (responseBean.getResponseType() != com.huawei.appgallery.serverreqkit.api.bean.ResponseBean.a.FROM_CACHE) {
            ˎ(null);
        }
        if (ˋ(responseBean)) {
            ˏ(o_cvu, responseBean);
        } else {
            ॱ(responseBean);
        }
        return false;
    }

    private void ˏ(BaseRequest o_cvu, ResponseBean responseBean) {
        if (responseBean instanceof JGWTabDetailResponse) {
            this.ʽ = ((JGWTabDetailResponse) responseBean).ᐝ();
            this.ˊ = ((JGWTabDetailResponse) responseBean).ʻ();
        }
        ˋ(responseBean.getResponseType() == com.huawei.appgallery.serverreqkit.api.bean.ResponseBean.a.FROM_CACHE);
        ˎ(true);
        ˎ(o_cvu, responseBean);
        ॱˎ();
        ʻॱ();
        ˋᐝ();
    }

    private void ʻॱ() {
        if (this.ͺ != null && UserSession.getInstance().isLoginSuccessful()) {
            Serializable ˊ = this.ͺ.ˊ();
            if (ˊ != null) {
                Intent intent = new Intent(ForumSectionDetailFragment.ˎ);
                intent.putExtra("section", ˊ);
                ll.ˏ(bqy.ˋ().ˏ()).ˋ(intent);
            }
        }
    }

    private void ॱ(ResponseBean responseBean) {
        ˋ(this.ʽॱ, false);
        ˋ(this.ʿ, false);
        if (!(this.ˎ == null || this.ॱᐝ == null)) {
            this.ˎ.ˏ(this.ॱᐝ.getString(j.ˋॱ));
        }
        if (ˎ(responseBean)) {
            if (this.ʼॱ != null) {
                this.ʼॱ.ˏ();
            }
            ˋ(this.ˊˋ, true);
        } else if (this.ʼॱ != null) {
            this.ʼॱ.ॱ(responseBean.getResponseCode(), responseBean.getRtnCode_());
        }
    }

    private boolean ˎ(ResponseBean responseBean) {
        return responseBean.getResponseCode() == 0 && responseBean.getRtnCode_() == 400001;
    }

    private void ᐝॱ() {
        this.ͺ = this.ˊॱ.ˊ();
        if (this.ͺ != null) {
            String str = null;
            if (this.ͺ.ˊ() != null) {
                str = this.ͺ.ˊ().ˏ();
                this.ॱॱ = this.ͺ.ˊ().ˊ();
            }
            if (this.ˎ != null) {
                this.ˎ.ˏ(str);
            } else {
                bqx.ˊ("ForumSectionDetailSegment", "iTitleListener is null");
            }
            if (this.ˋˋ != null) {
                this.ˋˋ.ˋ(this.ॱॱ);
            }
        } else {
            bqx.ˊ("ForumSectionDetailSegment", "headCardBean is null");
        }
        ForumSectionEnterCardBean ˋ = this.ˊॱ.ˋ();
        if (ˋ != null) {
            ˋ.ˊ(this.ॱॱ);
        }
        this.ॱˊ = this.ˊॱ.ˎ();
        this.ᐝॱ = this.ˊॱ.ˏ();
    }

    private void ॱˎ() {
        ᐝॱ();
        ʽॱ();
    }

    private void ʽॱ() {
        if (this.ʼॱ != null) {
            this.ʼॱ.ˏ();
        } else {
            bqx.ˊ("ForumSectionDetailSegment", "loadingCtl == null");
        }
        ˋ(this.ˊˋ, false);
        ˋ(this.ʽॱ, true);
        ˊᐝ();
        ˋ(this.ʿ, true);
        ʿ();
        ˎ(LayoutInflater.from(this.ॱᐝ));
        car.ˏ().ˎ();
        if (this.ˈ > 0) {
            this.ʽॱ.ˋ(this.ˈ, IPRoute.INTERVAL);
        }
    }

    private void ʿ() {
        if (this.ᐝॱ != null && this.ᐝॱ.size() > 0) {
            this.ˊᐝ = new b();
            this.ˋˊ.setAdapter(this.ˊᐝ);
            if (this.ʾ < 0 || this.ʾ >= this.ᐝॱ.size()) {
                this.ˋˊ.setCurrentTab(0);
            } else {
                this.ˋˊ.setCurrentTab(this.ʾ);
            }
        }
    }

    private void ˎ(LayoutInflater layoutInflater) {
        this.ॱˋ.removeAllViews();
        ˊ(layoutInflater);
        boolean ˋˊ = ˋˊ();
        ˊ(ˋˊ);
        ॱ(ˋˊ);
    }

    private void ˊ(LayoutInflater layoutInflater) {
        if (this.ͺ != null && !this.ʻ.startsWith("forum|forum_detail_app")) {
            BuoyForumSectionHeadCard buoyForumSectionHeadCard = new BuoyForumSectionHeadCard(this.ॱᐝ);
            View ˋ = buoyForumSectionHeadCard.ˋ(layoutInflater);
            buoyForumSectionHeadCard.ˏ(this.ͺ);
            this.ॱˋ.addView(ˋ);
        }
    }

    private boolean ˋˊ() {
        if (this.ॱˊ != null) {
            for (ForumNoticeCardBean forumNoticeCardBean : this.ॱˊ) {
                if (forumNoticeCardBean != null) {
                    List ˊ = forumNoticeCardBean.ˊ();
                    if (ˊ != null && ˊ.size() > 0) {
                        return true;
                    }
                }
            }
        }
        return false;
    }

    private void ॱ(boolean z) {
        if (this.ᐝॱ == null || this.ᐝॱ.size() <= 0) {
            bqx.ˊ("ForumSectionDetailSegment", "subhead bean == null");
            this.ˋॱ.setVisibility(8);
            return;
        }
        this.ˋॱ.ˎ(this.ॱᐝ, this.ᐝॱ, z, this.ʾ);
        for (int i = 0; i < this.ᐝॱ.size(); i++) {
            if ("forum|forum_detail_all".equals(((JGWTabInfo) this.ᐝॱ.get(i)).ʼ())) {
                this.ˏॱ = i;
            }
        }
    }

    private void ˊ(boolean z) {
        if (z) {
            float f = this.ॱᐝ.getResources().getDisplayMetrics().density;
            View view = new View(this.ॱᐝ);
            this.ॱˋ.addView(view, -1, (int) ((f * 24.0f) + 0.5f));
            view.invalidate();
            for (CardBean cardBean : this.ॱˊ) {
                if (cardBean != null) {
                    List ˊ = cardBean.ˊ();
                    if (!(ˊ == null || ˊ.size() == 0)) {
                        BuoyForumNoticeNode buoyForumNoticeNode = new BuoyForumNoticeNode(this.ॱᐝ);
                        buoyForumNoticeNode.ˊ(this.ॱˋ, null);
                        ForumNoticeCard ᐝ = buoyForumNoticeNode.ᐝ();
                        if (ᐝ != null) {
                            ᐝ.ˏ(cardBean);
                        }
                    }
                }
            }
        }
    }

    private void ˊᐝ() {
        this.ʽॱ.ॱ = this.ॱˋ;
        this.ʽॱ.ˏ = this.ˋॱ;
        this.ʽॱ.ˎ = this.ॱˎ;
        this.ʽॱ.setImmerse(false);
    }

    private void ˋ(View view, boolean z) {
        if (view != null) {
            view.setVisibility(z ? 0 : 8);
        }
    }

    private void ˊˋ() {
        ˎˎ();
        ˋ();
    }

    private boolean ˋ(ResponseBean responseBean) {
        return responseBean.getResponseCode() == 0 && responseBean.getRtnCode_() == 0;
    }

    private void ˋ(boolean z) {
        if (this.ˊॱ != null) {
            this.ˊॱ.ˏ(z);
        }
    }

    private void ˋˋ() {
        eoj.ˋ().ˎ(this.ʼ, this);
        ˍ();
    }

    private void ˍ() {
        IntentFilter intentFilter = new IntentFilter(e.ॱ);
        intentFilter.addAction("cardlist_show_toast_action");
        ll.ˏ(ContentManager.getInstant().getContext()).ˏ(this.ˋᐝ, intentFilter);
        ll.ˏ(ContentManager.getInstant().getContext()).ˏ(this.ˉ, intentFilter);
    }

    private void ˌ() {
        if (this.ˊॱ != null) {
            this.ˊॱ.ॱॱ();
        }
        ˎ(false);
        ˎˎ();
        ˋ();
    }

    private void ˎˎ() {
        if (this.ʼॱ != null) {
            this.ʼॱ.ॱ();
        }
        ˋ(this.ˊˋ, false);
        ˋ(this.ʿ, false);
        ˋ(this.ʽॱ, false);
    }

    private void ˋᐝ() {
        if (this.ॱᐝ != null) {
            bqw.ॱ.ˏ(bqy.ˋ().ˎ(this.ॱᐝ), bsv.ॱ(this.ʽ).ˎ(), this.ॱॱ);
        } else {
            bqx.ˋ("ForumSectionDetailSegment", "reportVisitSection activity null error");
        }
    }

    public void onDestroy() {
        bqx.ˊ("ForumSectionDetailSegment", "onDestroy, segmentId: " + this.ʼ);
        ˏˏ();
        super.onDestroy();
    }

    private void ˏˏ() {
        eoj.ˋ().ˊ(this.ʼ);
        ͺॱ();
    }

    private void ͺॱ() {
        ll.ˏ(ContentManager.getInstant().getContext()).ˋ(this.ˋᐝ);
        ll.ˏ(ContentManager.getInstant().getContext()).ˋ(this.ˉ);
    }
}
